package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.ListIterator;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class IterateThroughElementsArrayListUsingListIterator {
	public static void main(String[] args) {
		ArrayList arrayList = new ArrayList();
		arrayList.add("1");
		arrayList.add("2");
		arrayList.add("3");
		arrayList.add("4");
		arrayList.add("5");

		ListIterator itr = arrayList.listIterator();

		while (itr.hasNext())
			System.out.println(itr.next());

		while (itr.hasPrevious())
			System.out.println(itr.previous());

	}
}
